//
//  Stream.h
//  QBIM
//
//  Created by liu nian on 14-3-17.
//  Copyright (c) 2014年 liunian. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CFNetwork/CFNetwork.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <netinet/in.h>
#import <arpa/inet.h>

@interface Stream : NSObject {
    NSInputStream    *inStream;
    NSOutputStream    *outStream;
    NSMutableData    *dataBuffer;
    
    BOOL            _hasEstablished;
    id                _currentObject;
    int                _numCondition;
    
    BOOL            _isFirstFourBytes;
    uint            remainingToRead;
}

+ (Stream *)sharedStream;
- (void)requestData:(NSString *)requestString whoRequest:(id)currentObject condition:(int)numCondition;
- (void)manageData:(NSData *)receivedData;
@end
